//
//  AlertNetWork.m
//  LZMPro
//
//  Created by shan on 15/5/16.
//  Copyright © 2015年 LZS. All rights reserved.
//

#import "AlertNetWork.h"
#import <UIKit/UIKit.h>

@interface AlertNetWork ()<UIAlertViewDelegate>

@property (nonatomic,strong) UIAlertView *alertView ;

@end

@implementation AlertNetWork

+(void)AlertViewMessage:(NSString *)message andDismissTime:(NSTimeInterval)missTime;

{
    
    AlertNetWork *alert = [[AlertNetWork alloc]init];
    UIWindow *windows =   [UIApplication sharedApplication].keyWindow;
    
    UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:message delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
    
    
    alert.alertView = alertView;
    
    [windows addSubview:alertView];
    
    [windows bringSubviewToFront:alertView];
    
    
    [alertView show];
    
    [NSTimer scheduledTimerWithTimeInterval:missTime target:alert selector:@selector(missMyAlert) userInfo:nil repeats:NO];
    
    
    
}

-(void)missMyAlert//:(NSTimer *)timer
{
    [self.alertView  dismissWithClickedButtonIndex:0 animated:YES];
}
 

@end
